
#include "gtest/gtest.h"

#include "LinkedStack.h"

TEST( LinkedStackTest, Simple )
{
    int x;
    LinkedStack<int> S;

    S.Add( 1 ).Add( 2 ).Add( 3 ).Add( 4 );
    EXPECT_EQ( 4, S.Top() );

    S.Delete( x );
    EXPECT_EQ( 4, x );
    S.Delete( x );
    EXPECT_EQ( 3, x );
    S.Delete( x );
    EXPECT_EQ( 2, x );
    S.Delete( x );
    EXPECT_EQ( 1, x );

    EXPECT_THROW( S.Delete( x ), class OutOfBounds );

}

#include "main_stub.h"

